Russian imperialism believes that Ukraine, Belarus, Moldova, and Georgia are not independent nations, but just parts of the empire. To achieve this and, therefore, to complete the empire, Russia must conquer them.
Putin has referred a lot about the fall of the Soviet Union as a "disaster" and constantly repeats about lost territories.
If NATO's expansion was the cause of the invasion, Russia would have already launched a war against Finland and Sweden. The NATO-Russia border significantly increased after Finland's accession to NATO.
Before the invasion, Russia already shared a border with NATO countries - former Soviet states Estonia and Latvia and with a remote part of Norway.
The Ukraine-Russia border de jure measures 2,295 km, with 1,974 km being land and 321 km being the sea border.
The land border between Finland and Russia spans 1,300 km.
Currently, it is a 2,555 km land border between Russia and NATO.
Russia's borders stretch over 20,000 km.
Eastern and Central European countries joined NATO with no such goal as to attack Russia, but to protect themselves against potential Russian aggression. NATO expansion is considered a defensive response to Russia's imperial ambitions.
Finland joined NATO in April 2023. They obviously didn't need a reminder about the past. The last invasion of Finland from Russian territories was 80 years ago. At that time, it didn't have nuclear weapons, but now the whole globe is used to hearing about Russians bragging about using them or conducting an experiment in Kyiv.
NATO expansion has always been done democratically, as a will of the people. Russian expansion, on the contrary, is forced through military aggression and always happens through countless deaths (on both sides), bloodshed, annihilation and destruction of infrastructure.
Today, Ukrainian society also strongly supports NATO membership.
A survey conducted by Sociological Group "Rating" for IRI (Sept 27--Oct 1, 2024) found that 75% of Ukrainians would support NATO membership
in a referendum, with 7% opposing it.
This way, NATO's expansion is more about a collective effort to protect sovereignty and stability from Russia's constant attempts to redraw borders through force and aggression. And it's also not an attempt to attack and destroy the world's largest country.